package cn.kgm.user.dto.enums;

import cn.kgm.core.interfaces.BaseEnum;
import lombok.AllArgsConstructor;

/**
 * #技术改变自己
 *
 * @author: kappi
 * @email: yolo.jk@qq.com
 * @date: 2024/4/13 14:01周六
 * @package: cn.kgm.user.dto.enums.UserTypeEnums
 */
@AllArgsConstructor
public enum UserTypeEnums implements BaseEnum {

    SYS("SYS","系统用户"),
    CLIENT("CLIENT","C端客户"),
    DEALER("DEALER","经销商"),
    ;

    /**
     * 对应数据库的值
     */
    private String value;
    /**
     * 值的描述
     */
    private String desc;

    @Override
    public String getCode() {
        return BaseEnum.super.getCode();
    }

    @Override
    public String getDesc() {
        return this.getDesc();
    }

    @Override
    public String getExtra() {
        return BaseEnum.super.getExtra();
    }

    @Override
    public boolean eq(String val) {
        return BaseEnum.super.eq(val);
    }

    @Override
    public String getValue() {
        return BaseEnum.super.getValue();
    }

    @Override
    public String getDescByValue(String value) {
        for (UserTypeEnums userTypeEnums : values()) {
            if (value.equalsIgnoreCase(userTypeEnums.getValue())){
                return userTypeEnums.getDesc();
            }
        }
        return BaseEnum.super.getDescByValue(value);
    }
}
